var g_box_a2_1 = document.querySelectorAll('.g_box_a2_1');
console.log(g_box_a2_1);
for (var i = 0; i < 4; i++) {
    g_box_a2_1[i + 1].style.background = "0 0/100% 100% url(images/a" + (i + 1) + ".jpg) no-repeat";
}
var details_b = document.querySelector('.details_b').querySelectorAll('.details_a_1');
for (var i = 0; i < 7; i++) {
    details_b[i + 1].style.background = "0 0/100% 100% url(images/tui" + (i + 1) + ".jpg) no-repeat";
}